﻿namespace mathD
{
    export class Number4
    {
        v0: number;
        v1: number;
        v2: number;
        v3: number;
    }
    //重构原则1，将结构和计算函数全部分离
    export class Vector2
    {
        constructor(x: number = 0, y: number = 0)
        {
            this.x = x;
            this.y = y;
        }
        x: number;
        y: number;
        toString(): string
        {
            return this.x + "," + this.y;
        }
    }

    export class Rect
    {
        constructor(x: number = 0, y: number = 0, w: number = 0, h: number = 0)
        {
            this.x = x;
            this.y = y;
            this.w = w;
            this.h = h;
        }
        x: number;
        y: number;
        w: number;
        h: number;
        toString(): string
        {
            return this.x + "," + this.y + "," + this.w + "," + this.h;
        }
    }

    export class Border
    {
        constructor(l: number = 0, t: number = 0, r: number = 0, b: number = 0)
        {
            this.l = l;
            this.t = t;
            this.r = r;
            this.b = b;
        }
        l: number;
        t: number;
        r: number;
        b: number;
    }
}

